<template>
  <div class="view-container">
    <el-tabs tab-position="right" v-model="activeName" @tab-click="handleClick">
      <el-tab-pane label="点状图" name="first">
        <el-row>
          <el-button @click="dialogShow = true">添加本项目节点</el-button>
          <el-button>与我相关节点</el-button>
        </el-row>
      </el-tab-pane>
      <el-tab-pane label="列表视图" name="second">
        <el-table :data="tableData">
          <el-table-column label="节点名称"></el-table-column>
          <el-table-column label="状态"></el-table-column>
          <el-table-column label="责任人"></el-table-column>
          <el-table-column label="计划">
            <el-table-column label="开始"></el-table-column>
            <el-table-column label="结束"></el-table-column>
            <el-table-column label="天数"></el-table-column>
          </el-table-column>
          <el-table-column label="实际">
            <el-table-column label="开始"></el-table-column>
            <el-table-column label="结束"></el-table-column>
          </el-table-column>
          <el-table-column label="附件"></el-table-column>
          <el-table-column label="备注"></el-table-column>
        </el-table>
      </el-tab-pane>
    </el-tabs>

    <el-dialog title="新增自定义节点" :visible.sync="dialogShow" :before-close="beforeClose">
      <el-form label-width="100px">
        <el-form-item label="所属阶段">
          <el-select v-model="temp">
            <el-option v-for="(item,index) in jieDuan" :key="index" :label="item.pname"
                       :value="item.pid"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="节点排序">
          <el-input v-model="temp">
            <template slot="append">之后</template>
          </el-input>
        </el-form-item>
        <el-form-item label="节点名称">
          <el-input v-model="temp">
          </el-input>
        </el-form-item>
        <el-form-item label="节点责任人">
          <el-select v-model="temp" multiple >
            <el-option v-for="(item,index) in jieDuan" :key="index" :label="item.pname"
                       :value="item.pid"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="计划结束时间">
          <el-date-picker
            style="width: 100%;"
            v-model="temp"
            type="date"
            placeholder="选择日期">
          </el-date-picker>
        </el-form-item>
      </el-form>
      <div slot="footer">
        <!--<el-button type="default" @click="close">取 消</el-button>
        <el-button type="danger" @click="resetForm">重 置</el-button>-->
        <!--@click="submitForm"-->
        <el-button
          type="success"

          :loading="changeLoading">保 存</el-button>
      </div>
    </el-dialog>

  </div>
</template>

<script>
  import paramsAPI from '@/api/system/params'
  export default {
    name: 'JinDuJiHua',
    data() {
      return {
        tableData:[],
        activeName:'first',
        temp:'',
        jieDuan:[],
        dialogShow:false,
        changeLoading:false
      }
    },
    created() {
      this.getJieDuan()
    },
    methods: {
      getJieDuan(){
        paramsAPI.jieDuan().then(res=>{
          this.jieDuan = res.result
        })
      },
      handleClick(tab){

      },
      beforeClose(done){
        done(true)
      }
    }
  }
</script>

<style scoped lang="scss">

</style>
